package com.sgcc.nfc.lock.domain.repository

import com.sgcc.nfc.lock.core.network.NetworkResult
import com.sgcc.nfc.lock.domain.model.PagedList
import com.sgcc.nfc.lock.domain.model.UserProfile

interface UserRepository {
    suspend fun getUsers(
        page: Int,
        pageSize: Int,
        roleType: Int? = null,
        regionId: Long? = null,
        keyword: String? = null
    ): NetworkResult<PagedList<UserProfile>>

    suspend fun createUser(request: CreateUserParams): NetworkResult<Unit>
    suspend fun updateUser(request: UpdateUserParams): NetworkResult<Unit>
    suspend fun deleteUser(userId: Long): NetworkResult<Unit>
    suspend fun resetPassword(userId: Long): NetworkResult<Unit>

    data class CreateUserParams(
        val username: String,
        val password: String,
        val realName: String,
        val phone: String?,
        val roleType: Int,
        val regionId: Long?
    )

    data class UpdateUserParams(
        val userId: Long,
        val realName: String,
        val phone: String?,
        val roleType: Int,
        val regionId: Long?
    )
}
